package com.example.gifdemo;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

public class TestActivity  extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ImageView imageView = new ImageView(this);
		imageView.setScaleType(ScaleType.CENTER);
//		Drawable drawable = getResources().getDrawable(R.drawable.ic_launcher);
		GifDrawable drawable = new GifDrawable(this);
		drawable.setPath("/mnt/sdcard/test5.gif");
		drawable.setDecodeType(GifDrawable.ASYNC_DECODE);
		imageView.setImageDrawable(drawable);
		setContentView(imageView);
		ViewServer.get(this).addWindow(this);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		ViewServer.get(this).setFocusedWindow(this);
	}
	
	@Override
	protected void onDestroy() {
		super.onDestroy();
		ViewServer.get(this).removeWindow(this);
	}
}
